{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div style="margin-left: 736px;">
<div style="margin-left: 47px">
    <h1 >学生管理平台</h1>
    <button><a href="{% url 'add' %}">新增学生</a></button>
</div>

    <table border="1">
    <tr>
        <td>编号</td>
        <td>姓名</td>
        <td>性别</td>
        <td>班级</td>
        <td>年龄</td>
        <td>操作</td>
    </tr>
    {% for foo in all_stu %}
        <tr>
        <td>{{ forloop.counter }}</td>
        <td>{{ foo.1 }}</td>
        <td>{{ foo.2 }}</td>
        <td>{{ foo.3 }}</td>
        <td>{{ foo.4  }}</td>

        <td>
            <button><a href="{% url 'delete' id=foo.0%}" onclick="return del()">删除</a></button>
            <button><a href="{% url 'update' id=foo.0%}">修改</a></button>
        </td>
        </tr>
    {% endfor %}

</table>
</div>
<script src="{% static 'js/jq.min.js' %}"></script>
<script>
    function del() {
        if (confirm('你确定要删除吗')){
           return  true
        }
        else {
            return false
        }
    }
</script>
</body>
</html>